package com.cloud.rou.im.client.msg;

import com.cloud.rou.im.core.base.ResultVO;
import com.cloud.rou.im.core.util.SingletonUtil;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 */
public class MsgResponsePool {
    private Map<Long, ResultVO> resultMap;

    private MsgResponsePool() {
        this.resultMap = new ConcurrentHashMap<>();
    }

    public static MsgResponsePool getInstance() {
        return SingletonUtil.get(MsgResponsePool.class);
    }

    public void add(Long id, ResultVO vo) {
        resultMap.put(id, vo);
    }

    public ResultVO get(Long id) {
        return resultMap.get(id);
    }
}
